import request from "@/utils/request.js";

/**
 * 查询优惠券
 */
export function queryCoupons(data) {
    return request({
      url: `/jy-marketing/mgmt/marketing/coupons/queryCoupons`,
      method: "post",
      data,
    });
}

/**
 * 新增优惠券
 */
export function addCoupons(data) {
    return request({
      url: `/jy-marketing/mgmt/marketing/coupons/addCoupons`,
      method: "post",
      data,
    });
}
/**
 * 修改优惠券
 */
export function editCoupons(data) {
  return request({
    url: `/jy-marketing/mgmt/marketing/coupons/modifyCoupons`,
    method: "post",
    data,
  });
}
/**
 * 终止优惠券
 */
export function stopCoupons(params) {
    return request({
      url: `/jy-marketing/mgmt/marketing/coupons/stopCoupons`,
      method: "get",
      params,
    });
}
/**
 * 删除优惠券
 */
export function delCoupons(params) {
    return request({
      url: `/jy-marketing/mgmt/marketing/coupons/deleteCoupons`,
      method: "get",
      params,
    });
}

/**
 * 发放管理分页
 */
export function releaseMgmtPage(data) {
    return request({
      url: `/jy-marketing/coupons/task/releaseMgmtPage`,
      method: "post",
      data,
    });
}

/**
 * 新建-编辑 优惠券发放
 */
export function saveTask(data) {
  return request({
    url: `/jy-marketing/coupons/task/save`,
    method: "post",
    data,
  });
}
/**
 * 门店列表(营销)
 */
export function StoreManagementList(data) {
  return request({
    url: `/jy-business/api/store/pageMarket`,
    method: "post",
    data,
  });
}
/**
 * 终止发放
 */
export function stopTask(taskId) {
  return request({
    url: `/jy-marketing/coupons/task/terminate/${taskId}`,
    method: "post",
  });
}
/**
* 删除发放
*/
export function delTask(taskId) {
  return request({
    url: `/jy-marketing/coupons/task/${taskId}`,
    method: "delete"
  });
}
/**
 * 优惠券导入-进度查询
 */
export function getImportProgress(batchId) {
  return request({
    url: `/jy-marketing/activity/import/${batchId}`,
    method: "get"
  });
}
/**
 * 优惠卷流水页
 */
export function getCouponsFlow(data) {
  return request({
    url: `/jy-marketing/mgmt/marketing/coupons/couponsFlow`,
    method: "post",
    data,
  });
}
/**
 * 查询优惠券详情
 */
export function queryCouponsDetails(params) {
  return request({
    url: `/jy-marketing/mgmt/marketing/coupons/queryCouponsDetails`,
    method: "get",
    params
  });
}
/**
 * 优惠券-查看详情-活动规则
 */
export function couponsActivityRule(data) {
  return request({
    url: `/jy-marketing/mgmt/marketing/coupons/couponsActivityRule`,
    method: "post",
    data
  });
}
/**
 * 发放详情
 */
export function getTaskDetail(taskId) {
  return request({
    url: `/jy-marketing/coupons/task/${taskId}`,
    method: "get"
  });
}
/**
 * 发放详情分页
 */
export function releaseDetPage(data) {
  return request({
    url: `/jy-marketing/coupons/task/releaseDetPage`,
    method: "post",
    data
  });
}
/**
 * 优惠券领取详情
 */
export function couponsReceiveDetails(data) {
  return request({
    url: `/jy-marketing/mgmt/marketing/coupons/couponsReceiveDetails`,
    method: "post",
    data
  });
}